package org.tc.client.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.tc.client.entity.Comments;
import org.tc.client.mapper.CommentsMapper;
import org.tc.client.service.CommentsService;

import java.util.List;

@RestController
public class CommentsServiceImpl implements CommentsService {

    @Autowired
    private CommentsMapper commentsMapper;
    public List<Comments> selectCommentsByComId(Integer commodityid){
        System.out.println(commodityid);
        return commentsMapper.selectCommentsByComId(commodityid);
    }

    @Override
    public List<Comments> selectCommentsByGood(Integer commodityid ) {
        return commentsMapper.selectCommentsByGood(commodityid);
    }

    @Override
    public List<Comments> selectCommentsByMiddle(Integer commodityid) {
        return commentsMapper.selectCommentsByMiddle(commodityid);
    }

    @Override
    public List<Comments> selectCommentsByBad(Integer commodityid) {
        return commentsMapper.selectCommentsByBad(commodityid);
    }

    @Override
    public int updateByPrimaryKey(@RequestBody Comments record) {
        return commentsMapper.updateByPrimaryKey(record);
    }

    @Override
    public int deleteCommentsById(Integer id) {
        return commentsMapper.deleteCommentsById(id);
    }
    @Override
    public int insertComments(@RequestBody Comments comments){
        return commentsMapper.insertComments(comments);
    }
   }
